package com.xckj.cycling.utils;

import android.app.Activity;
import android.util.DisplayMetrics;

import androidx.annotation.NonNull;



/**
 * Created by TaiLin on 16/11/29.
 * 比例换算封装~~
 * 传入相应的原始数值,得到换算后的比例数值
 */
public class ScreenTools {



    public static int getScreenRealHeight(@NonNull Activity activity) {
        DisplayMetrics outMetrics = new DisplayMetrics();
        activity.getWindowManager().getDefaultDisplay().getRealMetrics(outMetrics);
        int heightPixels = outMetrics.heightPixels;
        int activityHeight = activity.findViewById(android.R.id.content).getHeight();
        if (heightPixels != activityHeight) {
            return activityHeight;
        }
        return heightPixels;
    }


}
